function submit_update(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber);
	var url='metaswitch/meta_update.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&longDistanceCarrier='+$('longDistanceCarrier').value;
	url=url+'&intraLATACarrier='+$('intraLATACarrier').value;
	url=url+'&internationalCarrier='+$('internationalCarrier').value;
	if ($('callAgentSignalingType').value == 'Analog Line/T1 CAS') {
        	url=url+'&gatewayName='+$('gatewayName').value;
        	url=url+'&accessDeviceName='+$('accessDeviceName').value;
        	url=url+'&accessLineNumber='+$('accessLineNumber').value;
	}
	url=url+'&callAgentSignalingType='+$('callAgentSignalingType').value;
	url=url+'&PIN='+$('PIN').value;
	url=url+'&serviceStatus='+$('serviceStatus').value;
	if ($('baseDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&cmd=meta_update_sub';
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_callername(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' CallerName');
	var url='metaswitch/meta_update_features.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&callerName='+$('callerName').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&cmd=meta_update_callername';
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_callernumber(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' CallerNumber');
	var url='metaswitch/meta_update_callernumber.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&callerNumber='+$('callerNumber').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&cmd=meta_update_callernumber';
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_voicemail(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' Voicemail');
	var url='metaswitch/meta_update_voicemail.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&voicemail='+$('voicemail').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_voicemail_cfrc(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' CFRC');
	var url='metaswitch/meta_update_voicemail_cfrc.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&cfrc='+$('cfrc').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_callwaiting(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' CallWaiting');
	var url='metaswitch/meta_update_callwaiting.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&callWaiting='+$('callWaiting').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_callwaitingwithcallerID(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' CallWaitingCallerID');
	var url='metaswitch/meta_update_callwaitingwithcallerID.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&callWaitingWithCallerID='+$('callWaitingWithCallerID').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_anonymouscallrejection(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' AnonCallRejection');
	var url='metaswitch/meta_update_anonymouscallrejection.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&anoncallrejection='+$('anonymousCallRejection').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_screenpop(directoryNumber) {
	MochaUI.notification('Updating '+directoryNumber+' Screenpop');
	var url='metaswitch/meta_update_screenpop.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&screenpop='+$('screenpop').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

function update_barredcalltypes(directoryNumber, calltype) {
	MochaUI.notification('Updating '+directoryNumber+' BiarredCallTypes');
	var url='metaswitch/meta_update_barredcalltypes.php';
	url=url+'?queryString='+$('directoryNumber').value;
	url=url+'&calltype='+calltype;
	url=url+'&value='+$(calltype+'BarredCallType').value;
	if ($('featuresDebug').checked) {
      	 	url=url+'&debug=True';
	}
	else {
	        url=url+'&debug=False';
	}
	url=url+'&nocache='+Math.random();
	MochaUI.updateContent({
	        'element': $('panel1'),
	        'loadMethod': 'xhr',
	        'url': url,
	        'title': 'Meta Query Results',
	        'padding': { top: 8, right: 8, bottom: 8, left: 8 }
	});
}

